package com.gitee.wsl.mathematics.statistics.distributions

import com.gitee.wsl.mathematics.statistics.exception.KStatException

annotation class Discrete
annotation class Continuous

abstract class DiscreteDistribution(seed: Int) : Distribution(seed, isDiscrete = true)

abstract class ContinuousDistribution(seed: Int): Distribution(seed, isContinuous = true) {

    /**
     * Calculates the Kullback-Leibler divergence between this distribution and the other one.
     *
     * @param other The other distribution.
     * @return The Kullback-Leibler divergence.
     * @throws KStatException If the Kullback-Leibler divergence cannot be calculated.
     * @throws KStatException If the other distribution is not the same type as this one.
     * @see [Kullback-Leibler divergence](https://en.wikipedia.org/wiki/Kullback%E2%80%93Leibler_divergence)
     */
    @Throws(KStatException::class)
    abstract fun klDivergence(other: ContinuousDistribution): Double

}
